home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Software Contest 3
/
FM Towns Software Contest 3.iso
/
exp
/
video_t
/
no1
/
c_sorse
/
help2.c
< prev
next >
Wrap
Text File
|
1994-01-07
|
3KB
|
136 lines
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <winb.h>
#include <te.h>
#include <fntb.h>
#include <gui.h>
int Dialog_help23 = -1 ;
int Text_help23 = -1 ;
int ScrollBar_help = -1 ;
int Message_help = -1 ;
int DButton_help2 = -1 ;
int _001Message_help = -1 ;
int _001DButton_help2 = -1 ;
int _002Message_help = -1 ;
int helpon=0;
extern int backid ;
extern int Dia_edit ;
extern int Dialog_menu ;
extern int Text ;
/* initDataHELP:ScrollBar_help:MJ_SCRLL40の呼び出し関数 */
int scroll_help(kobj, messId, argc, pev, trigger)
int kobj ;
int messId ;
int argc ;
EVENT *pev ;
int trigger ;
{
int prt,min,max,len,page;
TEHandle *pteHandle;
int line,flag;
/* スクロールバーの値を読み出す */
MMI_SendMessage(kobj, MM_GETSCROLL, 5, &prt, &min, &max, &len, &page) ;
MMI_SendMessage(Text_help23, MM_GETTEHANDLE, 1, &pteHandle) ;
/* アクティブなテキストを設定しスクロール行数を求める */
TE_Activate(pteHandle, 0, 0) ;
line = (prt - min) - pteHandle->dspline ;
if (line < 0)
{
flag = 0 ;
line *= -1 ;
}
else
{
flag = 1 ;
}
MG_mosDisp(2) ;
TE_Scroll(flag , line) ;
MG_mosDisp(3) ;
TE_Deactivate() ;
return NOERR ;
}
/* initDataHELP:DButton_help:MJ_DBUTTONL40の呼び出し関数 */
int help_on(kobj, messId, argc, pev, trigger)
int kobj ;
int messId ;
int argc ;
EVENT *pev ;
int trigger ;
{
MMI_SendMessage(Dialog_help23,MM_ERASE,0) ;
MMI_SendMessage(Dialog_help23,MM_DETACH,0) ;
/* メニューを選択可とします。 */
MTL_resetAtrObj(Dialog_menu, ~MS_DSPONLYL40) ;
MTL_resetAtrObj(backid, ~MS_DSPONLYL40) ;
helpon=0;
return NOERR ;
}
int help_check=0;
int help_go()
{
int TEXTVIEW=18;
int textLine;
TEHandle *th;
/* 背景を選択不可とします。*/
MTL_setAtrObj(backid, MS_DSPONLYL40) ;
MTL_setAtrObj(Dialog_menu, MS_DSPONLYL40) ;
MMI_SendMessage(Dialog_help23,MM_ATTACH,1,MMI_GetBaseObj()) ;
MMI_SendMessage(Dialog_help23, MM_WAKE, 0) ;
MMI_SendMessage(Dialog_help23, MM_SHOW, 0) ;
helpon=1;
if(help_check!=0) return 0;
help_fail();
MMI_SendMessage(Text_help23, MM_GETTEHANDLE, 1, &th) ;
TE_GetTextLine2(th,&textLine) ;
/* スクロールバーの大きさの設定 */
MMI_SendMessage(ScrollBar_help, MM_SETSCROLL, 5, TEXTVIEW - 1, TEXTVIEW - 1,
(textLine < TEXTVIEW) ? (TEXTVIEW - 1) : (textLine - 1) ,
TEXTVIEW, TEXTVIEW - 1) ;
help_check=1;
SetMouse(80,0xf);
MMI_SendMessage(ScrollBar_help, MM_SHOW, 0) ;
return NOERR ;
}
/* initDataHELP:_001DButton_help2:MJ_DBUTTONL40の呼び出し関数 */
int h_fail(kobj, messId, argc, pev, trigger)
int kobj ;
int messId ;
int argc ;
EVENT *pev ;
int trigger ;
{
int TEXTVIEW=18;
int textLine;
TEHandle *th;
help_fail();
MMI_SendMessage(Text_help23, MM_GETTEHANDLE, 1, &th) ;
TE_GetTextLine2(th,&textLine) ;
/* スクロールバーの大きさの設定 */
MMI_SendMessage(ScrollBar_help, MM_SETSCROLL, 5, TEXTVIEW - 1, TEXTVIEW - 1,
(textLine < TEXTVIEW) ? (TEXTVIEW - 1) : (textLine - 1) ,
TEXTVIEW, TEXTVIEW - 1) ;
help_check=1;
SetMouse(80,0xf);
MMI_SendMessage(ScrollBar_help, MM_SHOW, 0) ;
return NOERR ;
}